/**
 *
 */
package com.yuan.base.framework.http;

import android.util.SparseArray;

/**
 * 错误代码管理类
 * @author WuHaowen
 * @version 1.0
 */
public class BaseErrorCode {
	public final static int STATUS_OK = 0;
	public final static int STATUS_SERVER_ERROR = 1;// 服务器错误
	public final static int STATUS_BUSINESS_ERROR = 2;// 业务错误
	public final static int STATUS_TIMEOUT = 3;// 超时

	public final static int CLIENT_NETWORK_ERROR = 5;// 客户端无网络
	public final static int UNKNOW_ERROR = 6;// 未识别的错误


	// 网络链接
	public final static int IO_ERROR = 101;
	public final static int HTTP_ERROR = 103;
	public final static int JSON_PARSE_ERROR = 105;
	public final static int APP_HANDLE_ERROR = 106;


	public final static int SERVICE_500_ERROR = 500;// 服务器500错误
	public final static int TIMEOUT_ERROR = 504;// 请求超时
	public final static int HTTP_NOT_FIND = 404;

	// 文件存取
	public static final int FILE_NOTFOUND = 201;

	public static SparseArray<String> errorMsg = new SparseArray<String>();

	static {
		errorMsg.put(UNKNOW_ERROR, "未识别的错误");
		errorMsg.put(IO_ERROR, "无法连接到服务器");
		errorMsg.put(STATUS_BUSINESS_ERROR, "业务错误");
		errorMsg.put(STATUS_SERVER_ERROR, "服务器发生错误");
		errorMsg.put(HTTP_ERROR, "发送请求异常");
		errorMsg.put(TIMEOUT_ERROR, "请求超时");
		errorMsg.put(HTTP_NOT_FIND, "请求地址不存在");
		errorMsg.put(JSON_PARSE_ERROR, "服务器返回不正确的数据格式");
		errorMsg.put(APP_HANDLE_ERROR, "请求处理发生错误");
		errorMsg.put(SERVICE_500_ERROR, "服务器发生错误500");

	}
}
